博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Ecshop模板在首页调用指定分类的热销、推荐、新品商品
阅读量:6923 次
发布时间:2019-06-27

本文共 658 字,大约阅读时间需要 2 分钟。

在首页调出指定分类下的精品或新品或热销,分别在不同地方调用, 

使用下面的函数 

$children = get_children(你要调用的分类ID);$smarty->assign( 'bestGoods',     get_category_recommend_goods('best', $children));$smarty->assign( 'newGoods',      get_category_recommend_goods('new', $children));$smarty->assign( 'hotGoods',      get_category_recommend_goods('hot', $children));

复制代码

模板里调用方法:
该分类的精品商品: {$bestGoods}
该分类的最新商品: {$newGoods}
该分类的热门商品: {$hotGoods}
这些都是数组,在模板里用类似下面的循环处理 

  • {$goods.name|escape:html}

    零售价:{$goods.market_price}/每斤

    特   价:{$goods.shop_price}元/每斤

  •  

    转载于:https://www.cnblogs.com/shcolo/p/3331083.html

    你可能感兴趣的文章
    lua劈分字符串方法及实例
    查看>>
    HDU2222:Keywords Search——题解
    查看>>
    6. 使用Axis开发WebService程序
    查看>>
    引用 英语学习的六大原则
    查看>>
    Spring中ClassPathXmlApplicationContext类的简单使用
    查看>>
    java8的LocalDateTime真心好用(补充Period.between的大坑)
    查看>>
    XMLHelper类 源码(XML文档帮助类,静态方法,实现对XML文档的创建,及节点和属性的增、删、改、查)...
    查看>>
    装饰器叠加和有参装饰器
    查看>>
    基本位运算
    查看>>
    高精度计算
    查看>>
    [转] 投资策略及投资体系
    查看>>
    多张报表导出到一个多sheet页excel
    查看>>
    MongoDB_pymongo
    查看>>
    JS 定時刷新父類頁面
    查看>>
    Android Studio 导入项目 出现安装Error:Cause: failed to find target with hash string 'android-23' 等错误...
    查看>>
    iPhone 物理尺寸与分辨率
    查看>>
    软工课后作业01(P18 第四题)
    查看>>
    maven jetty 内存设置
    查看>>
    【1247】海选女主角 sdutOJ
    查看>>
    hdu 1573 X问题
    查看>>